package com.esd.device.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.esd.common.pojo.R;
import com.esd.device.entity.Device;
import com.esd.device.entity.dto.DeviceDto;
import com.esd.device.entity.vo.DeviceVo;
import com.esd.device.entity.vo.DustStatusVo;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public interface DeviceService extends IService<Device> {

    /**
     * 根据条件分页查询终端
     * @param params 查询条件实体
     * @return R
     */
    R selectDevicePage(Map<String,Object> params);

    /**
     * 添加终端
     * @param deviceDto 终端实体
     * @return R
     */
    R addDevice(DeviceDto deviceDto);

    R updateDevice(DeviceDto deviceDto);

    Device selectByStationID(String stationID) ;

    R uploadDeviceData(MultipartFile file) throws IOException;

    R deleteDevice(Long deviceId);

    R selectByLine(Long lineId);

    R batchDelete(List<Long> ids);

    DeviceDto selectById(Long deviceId);

    R getByLineAndType(String lineName, String deviceType);

    int countChannels(Long deviceId);

    Map<String, Integer> getCount();

    List<DeviceVo> selectVosByServerIp(String serverIp);

    /**
     * 获取统计数据
     * @return 统计数据
     */
    R getStatisticsData();

    R getUnNormalData();

    List<HashMap<String, String>> getSortDeviceList(Long lineId);

    R sortDevice(String stationId1, String stationId2);

    R enabledMon(Long id, String value);

    Boolean getViewOn(String stationId);

    List<List<DustStatusVo>> getDustRows();

    R getLinesData( Long [] lineIds);

    R getDeviceVoByDeviceId(Long deviceId);
}
